//
//  WYBOSSTeamSectionView.m
//  Boss
//
//  Created by admin on 2018/7/3.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "WYBOSSTeamSectionView.h"
#import "PNChart.h"
#import "Boss-Bridging-Header.h"

@interface CubicLineSampleFillFormatter :NSObject <IChartValueFormatter>
{
    
}
@end
@implementation CubicLineSampleFillFormatter

-(NSString *)stringForValue:(double)value entry:(ChartDataEntry *)entry dataSetIndex:(NSInteger)dataSetIndex viewPortHandler:(ChartViewPortHandler *)viewPortHandler
{
    return @"";
}

@end

@interface XDateFormatter:NSObject<IChartAxisValueFormatter>
@property (nonatomic,strong)NSArray *xArray;
@end

@implementation XDateFormatter


- (NSString * _Nonnull)stringForValue:(double)value axis:(ChartAxisBase * _Nullable)axis {
    int index = (int) value;
    if (index >= self.xArray.count) {
        index = self.xArray.count - 1;
    }
    NSString *str1 = self.xArray[index];
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
    dateFormatter.dateFormat = @"yyyy-MM-dd";
    NSDate *date = [dateFormatter dateFromString:str1];
    NSLog(@"%@",date);
    dateFormatter.dateFormat = @"M-d";
    
    NSString *str = [dateFormatter stringFromDate:date];
    
    
    
    
    return str;
}

@end

@interface YDateFormatter:NSObject<IChartAxisValueFormatter>
@property (nonatomic,strong)NSArray *xArray;
@end

@implementation YDateFormatter


- (NSString * _Nonnull)stringForValue:(double)value axis:(ChartAxisBase * _Nullable)axis {
   
    if ( (int)(value*100) % 100 == 0) {
        
        NSLog(@"aaaaa%d=====%dssssss",(int)(value*100) % 1*100,(int)(value*100));
        
        
        
        return [NSString stringWithFormat:@"%d",(int)value];
    } else {
        return @"";
    }
    
}

@end


//#import <Charts/Charts-umbrella.h>
@interface WYBOSSTeamSectionView()<ChartViewDelegate>

//@property (nonatomic, strong) SJLineChart *lineChart;
//@property (nonatomic) PNLineChart * lineChart;
@property (nonatomic,strong)UILabel *Threelabel;
@property (nonatomic,strong)LineChartView *chartView;
@property (nonatomic,strong)LineChartView *linechartView;

@end


@implementation WYBOSSTeamSectionView
-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self createSubViews];
    }
    
    
    return self;
}

-(void)createSubViews
{
    UIView *backgroundView = [[UIView alloc]init];
    [self addSubview:backgroundView];
    backgroundView.backgroundColor = kColorMainColor;
    [backgroundView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.mas_equalTo(0);
        make.height.mas_equalTo(100);
    }];
    
    
    UIView *messageView = [[UIView alloc]init];
    [backgroundView addSubview:messageView];
    messageView.backgroundColor = kColorMainColor;
    
    UIView *rewardView = [[UIView alloc]init];
    [backgroundView addSubview:rewardView];
    rewardView.backgroundColor = kColorMainColor;
    
    [messageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.bottom.mas_equalTo(-10);
        make.top.mas_equalTo(32);
        make.width.mas_equalTo(kScreenWidth/2.0);
    }];
    
    [rewardView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(0);
        make.bottom.mas_equalTo(-10);
        make.top.mas_equalTo(32);
        make.width.mas_equalTo(kScreenWidth/2.0);
    }];
    
    UILabel *personLabel = [[UILabel alloc]init];
    [messageView addSubview:personLabel];
    [personLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(messageView);
        make.top.mas_equalTo(0);
    }];
    personLabel.text = @"0人";
    self.personLabel = personLabel;
    personLabel.textColor = [UIColor whiteColor];
    
    UILabel *allInvLabel = [[UILabel alloc]init];
    [messageView addSubview:allInvLabel];
    [allInvLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(messageView);
        make.top.equalTo(personLabel.mas_bottom).offset(4);
    }];
    allInvLabel.text = @"总计邀请";
    allInvLabel.textColor = [UIColor whiteColor];
    
    
    
    
    UILabel *moneyLabel = [[UILabel alloc]init];
    [rewardView addSubview:moneyLabel];
    [moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(rewardView);
        make.top.mas_equalTo(0);
    }];
    moneyLabel.text = @"0元";
    self.moenyLabel = moneyLabel;
    moneyLabel.textColor = [UIColor whiteColor];
    
    
    
    UILabel *allLabel = [[UILabel alloc]init];
    [rewardView addSubview:allLabel];
    [allLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(rewardView);
        make.top.equalTo(moneyLabel.mas_bottom).offset(4);
    }];
    allLabel.text = @"总计奖励";
    allLabel.textColor = [UIColor whiteColor];
    
    
    
    
    UILabel *Threelabel = [[UILabel alloc]init];
    self.Threelabel = Threelabel;
    [self addSubview:Threelabel];
    [Threelabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(16);
        make.top.equalTo(backgroundView.mas_bottom).offset(16);
    }];
    
    Threelabel.text = @"近三十天邀请好友增长趋势";
    
    
//     self.lineChart = [[SJLineChart alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth*2-40, 200)];
//    self.lineChart.title = @"消费趋势图"; // 折线图名称
//    self.lineChart.maxValue = 6;   // 最大值
//    self.lineChart.yMarkTitles = @[@"10",@"20",@"30"];
//    NSMutableArray *tempArr = [NSMutableArray array];
//    for (int i = 0; i<7; i++)
//    {
//        NSInteger str = i;
//        NSDictionary *tempDic=@{@"item":[NSString stringWithFormat:@"%d",i],@"count":@(str)};
//        [tempArr addObject:tempDic];
//    }
//
//
//
//    [self.lineChart setXMarkTitlesAndValues:tempArr titleKey:@"item" valueKey:@"count"];
//    [self.lineChart mapping];
//
//    [self addSubview:self.lineChart];
//
//    [self.lineChart mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.right.mas_equalTo(0);
//        make.height.mas_equalTo(150);
//        make.top.equalTo(Threelabel.mas_bottom).offset(30);
//    }];
    
//    UILabel *Jlabel = [[UILabel alloc]init];
//    [self addSubview:Jlabel];
//    [Jlabel mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.mas_equalTo(16);
//        make.top.equalTo(self.lineChart.mas_bottom).offset(30);
//    }];
//    Jlabel.text = @"邀请好友记录";
    
    
    //[self addChartView];
    //[self initLineChartView];
    [self createLineChartView];
}
-(void)createLineChartView
{
    _chartView =[[LineChartView alloc]init];
    _chartView.frame = CGRectMake(10, 60, ScreenWidth - 20, 260);
    _chartView.legend.form = ChartLegendFormNone;
    //说明图标
    _chartView.dragEnabled = YES;
    //拖动手势
    _chartView.rightAxis.enabled = NO;//隐藏右Y轴
    _chartView.chartDescription.enabled = NO;//不显示描述label
    _chartView.doubleTapToZoomEnabled = NO; //禁止双击缩放
    _chartView.drawGridBackgroundEnabled = NO;
    _chartView.drawBordersEnabled= NO;
    
     _chartView.dragEnabled = YES; //拖动气泡
    [_chartView animateWithXAxisDuration:2.20  easingOption:ChartEasingOptionEaseOutBack];//加载动画时长
    
    [self addSubview:_chartView];
    _chartView.delegate = self;
    
    _chartView.chartDescription.enabled = NO;
    [_chartView setNoDataText:@""];
    [_chartView setDrawBordersEnabled:NO];
    _chartView.legend.enabled = NO;
    
    //_chartView.chartDescription.enabled = NO;
    
    
    
    
    _chartView.dragEnabled = YES;
    _chartView.scaleYEnabled = false;
    _chartView.scaleXEnabled = false;
    _chartView.pinchZoomEnabled = NO;
    _chartView.doubleTapToZoomEnabled = NO;
    // _chartView.exclusiveTouch = YES;
    
    [_chartView setScaleEnabled:YES];
    _chartView.pinchZoomEnabled = YES;
    _chartView.drawGridBackgroundEnabled = NO;
    
    // x-axis limit line
    ChartLimitLine *llXAxis = [[ChartLimitLine alloc] initWithLimit:10.0 label:@"Index 10"];
    llXAxis.lineWidth = 4.0;
    llXAxis.lineDashLengths = @[@(10.f), @(10.f), @(0.f)];
    llXAxis.labelPosition = ChartLimitLabelPositionRightBottom;
    llXAxis.valueFont = [UIFont systemFontOfSize:10.f];
    
    //[_chartView.xAxis addLimitLine:llXAxis];
    
    _chartView.xAxis.gridLineDashLengths = @[@10.0, @10.0];
    _chartView.xAxis.gridLineDashPhase = 0.f;
    
    //    ChartLimitLine *ll1 = [[ChartLimitLine alloc] initWithLimit:150.0 label:@"Upper Limit"];
    //    ll1.lineWidth = 4.0;
    //    ll1.lineDashLengths = @[@5.f, @5.f];
    //    ll1.labelPosition = ChartLimitLabelPositionRightTop;
    //    ll1.valueFont = [UIFont systemFontOfSize:10.0];
    
    //    ChartLimitLine *ll2 = [[ChartLimitLine alloc] initWithLimit:-30.0 label:@"Lower Limit"];
    //    ll2.lineWidth = 4.0;
    //    ll2.lineDashLengths = @[@5.f, @5.f];
    //    ll2.labelPosition = ChartLimitLabelPositionRightBottom;
    //    ll2.valueFont = [UIFont systemFontOfSize:10.0];
    //
    ChartYAxis *leftAxis = _chartView.leftAxis;
    [leftAxis removeAllLimitLines];
    ////    [leftAxis addLimitLine:ll1];
    ////    [leftAxis addLimitLine:ll2];
    //    leftAxis.axisMaximum = 200.0;
    //    leftAxis.axisMinimum = -50.0;
    //    leftAxis.gridLineDashLengths = @[@5.f, @5.f];
    //    leftAxis.drawZeroLineEnabled = NO;
    //    leftAxis.drawLimitLinesBehindDataEnabled = YES;
    leftAxis.labelTextColor = [UIColor grayColor];
    leftAxis.labelFont = [UIFont systemFontOfSize:12];
    leftAxis.drawGridLinesEnabled = YES;
    leftAxis.drawLabelsEnabled = YES;
    leftAxis.granularityEnabled = NO;
    leftAxis.drawZeroLineEnabled = NO;
    leftAxis.gridColor = [UIColor colorWithRed:230/255.0 green:230/255.0 blue:230/255.0 alpha:1.0];
    // leftAxis.labelPosition = outsideChart;
    //  leftAxis.valueFormatter
    YDateFormatter *ydate =  [[YDateFormatter alloc]init];
    [leftAxis setValueFormatter:ydate];
    
    
    
    
    
    ChartXAxis  *xAxis = _chartView.xAxis;
    [xAxis setLabelPosition:XAxisLabelPositionBottom];
    xAxis.enabled = YES;
    xAxis.drawAxisLineEnabled = NO;
    xAxis.drawGridLinesEnabled = NO;
    xAxis.labelTextColor = [UIColor grayColor];
    xAxis.labelFont = [UIFont systemFontOfSize:12];
    
    //ChartYAxis *rightAxis = _chartView.
    
    
    
    _chartView.rightAxis.enabled = NO;

    
    
    
    
    
   // [self setDataCount:10 range:10];
    [_chartView mas_makeConstraints:^(MASConstraintMaker *make) {
    make.left.mas_equalTo(0);
    make.right.mas_equalTo(-10);
    make.height.mas_equalTo(200);
    make.top.equalTo(self.Threelabel.mas_bottom).offset(30);
    }];
    
        UILabel *Jlabel = [[UILabel alloc]init];
        [self addSubview:Jlabel];
        [Jlabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(16);
            make.top.equalTo(_chartView.mas_bottom).offset(30);
        }];
        Jlabel.text = @"成功邀请记录";
    
    
}
-(void)setXArray:(NSArray *)XArray WithYArray:(NSArray *)YArray
{
    NSMutableArray *values = [[NSMutableArray alloc] init];
    NSMutableArray *colorArray= [[NSMutableArray alloc]init];
    for (int i = 0; i < XArray.count; i++)
    {

        double val = [YArray[i] floatValue];
        [values addObject:[[ChartDataEntry alloc] initWithX:i y:val icon: [UIImage imageNamed:@"icon"]]];
        UIColor *color = [UIColor clearColor];
        [colorArray addObject:color];
    }
    LineChartDataSet *set1 = nil;
    if (_chartView.data.dataSetCount > 0)
    {
        set1 = (LineChartDataSet *)_chartView.data.dataSets[0];
        set1.values = values;
        [_chartView.data notifyDataChanged];
        [_chartView notifyDataSetChanged];
    }
    else
    {
        
        set1 = [[LineChartDataSet alloc] initWithValues:values label:@"DataSet 1"];
        set1.mode = LineChartModeHorizontalBezier;
        set1.cubicIntensity = 0.2;
        set1.drawCirclesEnabled = NO;
        set1.lineWidth = 1.8;
        set1.circleRadius = 4.0;
        [set1 setCircleColor:UIColor.whiteColor];
        set1.highlightColor = [UIColor colorWithRed:244/255.f green:117/255.f blue:117/255.f alpha:1.f];
        [set1 setColor:UIColor.whiteColor];
        set1.fillColor = UIColor.whiteColor;
        set1.fillAlpha = 1.f;
        set1.drawHorizontalHighlightIndicatorEnabled = NO;
        set1.drawIconsEnabled = NO;
        set1.highlightEnabled = NO;
        [set1 setValueFormatter:[[CubicLineSampleFillFormatter alloc]init]];
        
        
        
        
        
        
        
        
        NSArray *gradientColors = @[
                                    (id)[ChartColorTemplates colorFromString:@"#00ff0000"].CGColor,
                                    (id)[ChartColorTemplates colorFromString:@"#ffff0000"].CGColor
                                    ];
        CGGradientRef gradient = CGGradientCreateWithColors(nil, (CFArrayRef)gradientColors, nil);
        
        set1.fillAlpha = 1.f;
        set1.fill = [ChartFill fillWithLinearGradient:gradient angle:90.f];
        set1.drawFilledEnabled = YES;
        
        CGGradientRelease(gradient);
        
        NSMutableArray *dataSets = [[NSMutableArray alloc] init];
        [dataSets addObject:set1];
        
        LineChartData *data = [[LineChartData alloc] initWithDataSets:dataSets];
        //data.xMax = 7;
        
        _chartView.data = data;
        
        XDateFormatter *xformater = [[XDateFormatter alloc]init];
        xformater.xArray = XArray;
        ChartXAxis  *xAxis = _chartView.xAxis;
        [xAxis setValueFormatter:xformater];
       // [xAxis setAxisMaximum:7];
    }
    [self.chartView setVisibleXRangeMaximum:7];
   // [self.chartView moveViewToX:30.0f];
    [_chartView.data notifyDataChanged];
    [_chartView notifyDataSetChanged];
}




- (void)setDataCount:(int)count range:(double)range
{
    
    
}





- (void)initLineChartView{
    
    
  
     _chartView =  [[LineChartView alloc]init];
      _chartView.delegate = self;
     _chartView.frame = CGRectMake(10, 60, ScreenWidth - 20, 260);
    _chartView.chartDescription.enabled = NO;
    [_chartView setNoDataText:@""];
    [_chartView setDrawBordersEnabled:NO];
    _chartView.legend.enabled = NO;
    
    //_chartView.chartDescription.enabled = NO;
    _chartView.dragEnabled = YES;
    _chartView.scaleYEnabled = false;
    _chartView.scaleXEnabled = YES;
    // _chartView.exclusiveTouch = YES;
    
    [_chartView setScaleEnabled:YES];
    _chartView.pinchZoomEnabled = YES;
    _chartView.drawGridBackgroundEnabled = NO;
    
    // x-axis limit line
    ChartLimitLine *llXAxis = [[ChartLimitLine alloc] initWithLimit:10.0 label:@"Index 10"];
    llXAxis.lineWidth = 4.0;
    llXAxis.lineDashLengths = @[@(10.f), @(10.f), @(0.f)];
    llXAxis.labelPosition = ChartLimitLabelPositionRightBottom;
    llXAxis.valueFont = [UIFont systemFontOfSize:10.f];
    
    //[_chartView.xAxis addLimitLine:llXAxis];
    
    _chartView.xAxis.gridLineDashLengths = @[@10.0, @10.0];
    _chartView.xAxis.gridLineDashPhase = 0.f;
    
    //    ChartLimitLine *ll1 = [[ChartLimitLine alloc] initWithLimit:150.0 label:@"Upper Limit"];
    //    ll1.lineWidth = 4.0;
    //    ll1.lineDashLengths = @[@5.f, @5.f];
    //    ll1.labelPosition = ChartLimitLabelPositionRightTop;
    //    ll1.valueFont = [UIFont systemFontOfSize:10.0];
    
    //    ChartLimitLine *ll2 = [[ChartLimitLine alloc] initWithLimit:-30.0 label:@"Lower Limit"];
    //    ll2.lineWidth = 4.0;
    //    ll2.lineDashLengths = @[@5.f, @5.f];
    //    ll2.labelPosition = ChartLimitLabelPositionRightBottom;
    //    ll2.valueFont = [UIFont systemFontOfSize:10.0];
    //
    ChartYAxis *leftAxis = _chartView.leftAxis;
    [leftAxis removeAllLimitLines];
    ////    [leftAxis addLimitLine:ll1];
    ////    [leftAxis addLimitLine:ll2];
    //    leftAxis.axisMaximum = 200.0;
    //    leftAxis.axisMinimum = -50.0;
    //    leftAxis.gridLineDashLengths = @[@5.f, @5.f];
    //    leftAxis.drawZeroLineEnabled = NO;
    //    leftAxis.drawLimitLinesBehindDataEnabled = YES;
    leftAxis.labelTextColor = [UIColor grayColor];
    leftAxis.labelFont = [UIFont systemFontOfSize:12];
    leftAxis.drawGridLinesEnabled = YES;
    leftAxis.drawLabelsEnabled = YES;
    leftAxis.granularityEnabled = NO;
    leftAxis.drawZeroLineEnabled = NO;
    leftAxis.gridColor = [UIColor colorWithRed:230/255.0 green:230/255.0 blue:230/255.0 alpha:1.0];
    // leftAxis.labelPosition = outsideChart;
    //  leftAxis.valueFormatter
    
    
    
    
    
    
    ChartXAxis  *xAxis = _chartView.xAxis;
    [xAxis setLabelPosition:XAxisLabelPositionBottom];
    xAxis.enabled = YES;
    xAxis.drawAxisLineEnabled = NO;
    xAxis.drawGridLinesEnabled = NO;
    xAxis.labelTextColor = [UIColor grayColor];
    xAxis.labelFont = [UIFont systemFontOfSize:12];
//    xAxis setValueFormatter:(id<IChartAxisValueFormatter> _Nullable)
    
    
    
    
    _chartView.rightAxis.enabled = NO;
    
    //[_chartView.viewPortHandler setMaximumScaleY: 2.f];
    //[_chartView.viewPortHandler setMaximumScaleX: 2.f];
    
//    BalloonMarker *marker = [[BalloonMarker alloc]
//                             initWithColor: [UIColor colorWithWhite:180/255. alpha:1.0]
//                             font: [UIFont systemFontOfSize:12.0]
//                             textColor: UIColor.whiteColor
//                             insets: UIEdgeInsetsMake(8.0, 8.0, 20.0, 8.0)];
//    marker.chartView = _chartView;
//    marker.minimumSize = CGSizeMake(80.f, 40.f);
//    _chartView.marker = marker;
//
    _chartView.legend.form = ChartLegendFormLine;
    //    _chartView.dragEnabled = YES;
    
    
    
    [_chartView animateWithXAxisDuration:2.5];
    

    
    
    
    
    [self addSubview:_chartView];
//    [_chartView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.top.right.mas_equalTo(0);
//        make.height.mas_equalTo(0);
//    }];
   
//    BalloonMarker
    
    
}





//-(void)addChartView
//{
//    self.lineChart.backgroundColor = [UIColor whiteColor];
//    self.lineChart.yGridLinesColor = [UIColor grayColor];
//    [self.lineChart.chartData enumerateObjectsUsingBlock:^(PNLineChartData *obj, NSUInteger idx, BOOL *stop) {
//        obj.pointLabelColor = [UIColor blackColor];
//    }];
//
//    self.lineChart = [[PNLineChart alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH*2, 200.0)];
//    self.lineChart.showCoordinateAxis = YES;
//    self.lineChart.yLabelFormat = @"%1.1f";
//    self.lineChart.xLabelFont = [UIFont fontWithName:@"Helvetica-Light" size:8.0];
//    //        [self.lineChart setXLabels:@[@"SEP 1", @"SEP 2", @"SEP 3", @"SEP 4", @"SEP 5", @"SEP 6", @"SEP 7"]];
//    [self.lineChart setXLabels:@[@"6-27", @"6-28", @"6-29"]];
//    self.lineChart.yLabelColor = [UIColor blackColor];
//    self.lineChart.xLabelColor = [UIColor blackColor];
//
//
//    self.lineChart.showGenYLabels = NO;
//    self.lineChart.showYGridLines = YES;
//
//    self.lineChart.yFixedValueMax = 200;
//    self.lineChart.yFixedValueMin = 0.0;
//
//    [self.lineChart setYLabels:@[
//                                 @"0",
//                                 @"50",
//                                 @"100",
//                                 ]
//     ];
//    NSArray *data02Array = @[@20.0, @18.1, @26.4, @30.2, @12.2, @16.2, @27.2];
//    PNLineChartData *data02 = [PNLineChartData new];
//    //  data02.dataTitle = @"Beta";
//    data02.pointLabelColor = [UIColor blackColor];
//    data02.color = PNTwitterColor;
//    data02.alpha = 0.5f;
//    data02.itemCount = data02Array.count;
//    data02.inflexionPointStyle = PNLineChartPointStyleCircle;
//    data02.getData = ^(NSUInteger index) {
//        CGFloat yValue = [data02Array[index] floatValue];
//        return [PNLineChartDataItem dataItemWithY:yValue];
//    };
//
//    self.lineChart.chartData = @[data02];
//    [self.lineChart.chartData enumerateObjectsUsingBlock:^(PNLineChartData *obj, NSUInteger idx, BOOL *stop) {
//        obj.pointLabelColor = [UIColor blackColor];
//    }];
//
//
//    [self.lineChart strokeChart];
//    self.lineChart.delegate = self;
//
//    UIScrollView *scrollView =[[UIScrollView alloc]init];
//    [self addSubview:scrollView];
//    [scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.right.mas_equalTo(0);
//        make.height.mas_equalTo(200);
//        make.top.equalTo(self.Threelabel.mas_bottom).offset(30);
//    }];
//
//
//
//
//    [scrollView addSubview:self.lineChart];
//
//    self.lineChart.legendStyle = PNLegendItemStyleStacked;
//    self.lineChart.legendFont = [UIFont boldSystemFontOfSize:12.0f];
//    self.lineChart.legendFontColor = [UIColor redColor];
//
//
////    [self.lineChart mas_makeConstraints:^(MASConstraintMaker *make) {
////        make.top.left.right.bottom.mas_equalTo(0);
//////        make.left.right.mas_equalTo(0);
//////        make.height.mas_equalTo(200);
//////        make.top.equalTo(self.Threelabel.mas_bottom).offset(30);
////    }];
//
//    [scrollView setContentSize:self.lineChart.size];
//
//

//}
#pragma mark - ChartViewDelegate

- (void)chartValueSelected:(ChartViewBase * __nonnull)chartView entry:(ChartDataEntry * __nonnull)entry highlight:(ChartHighlight * __nonnull)highlight
{
    NSLog(@"chartValueSelected");
}

- (void)chartValueNothingSelected:(ChartViewBase * __nonnull)chartView
{
    NSLog(@"chartValueNothingSelected");
}



@end
